package org.dromara.application.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.dromara.application.domain.Application;
import org.dromara.application.domain.vo.ApplicationVo;
import org.dromara.common.core.domain.dto.UserDTO;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;

import java.util.List;

/**
 * 应用管理Mapper接口
 *
 * @author YCJZ
 * @date 2025-09-16
 */
public interface ApplicationMapper extends BaseMapperPlus<Application, ApplicationVo> {

    /**
     * 查询已分配用户应用列表
     */
    Page<UserDTO> selectAllocatedList(@Param("page") Page<UserDTO> build,@Param(Constants.WRAPPER) QueryWrapper<UserDTO> wrapper);

    /**
     * 查询未分配用户应用列表
     */
    Page<UserDTO> selectUnallocatedList(@Param("page") Page<UserDTO> build,@Param(Constants.WRAPPER)  QueryWrapper<UserDTO> wrapper);

    /**
     * 获取登录用户下的应用列表
     */
    List<ApplicationVo> selectVoListXml(@Param("userId") Long userId, @Param("appTypeId") Long appTypeId);
}
